package core;

public class Nivel {
	private final String Nivel;
	private final char N;
	private final int Costo;
	
	public Nivel(String pNivel)
	{
		Nivel=pNivel;
		if (pNivel=="Low")
		{
			N='L';
			Costo=100;
		}
		else if (pNivel=="Medium")
		{
			N='M';
			Costo=250;
		}
		else if (pNivel=="High")
		{
			N='H';
			Costo=500;
		}
		else
		{
			N='E';
			Costo=-1;
		}
	}
	public Nivel(char pNivel)
	{
		N=pNivel;
		switch(N)
		{
		case 'L': Nivel="Low";Costo=100;break;
		case 'M': Nivel="Medium";Costo=250;break;
		case 'H': Nivel="High";Costo=500;break;
		default : Nivel="Error";Costo=-1;break;  
		}
	}
	
	public String getNivel()
	{
		return Nivel;
	}
	public char getN()
	{
		return N;
	}
	
	public static boolean Validar(String pNivel)
	{
		if (pNivel=="Low"||pNivel=="Medium"||pNivel=="High")
			return true;
		else 
			return false;
	}
	public static boolean Validar(char pNivel)
	{
		if(pNivel=='L'||pNivel=='M'||pNivel=='H')
			return true;
		else
			return false;
	}
	
	public boolean Igual(String pNivel)
	{
		return Nivel==pNivel;
	}
	public boolean Igual(char pNivel)
	{
		return N==pNivel;
	}
	public boolean Igual(Nivel pNivel)
	{
		return Nivel==pNivel.Nivel;
	}
	
	public int getCosto()
	{
		return Costo;
	}
	public int getRetirar()
	{
		return Costo/2;
	}
	
	public String toString()
	{
		return Nivel;
	}

}
